import { ADD, MINUS } from "./type";

const reduce = (state = { number: 0 }, action) => {
  const { number } = state;
  switch (action.type) {
    case ADD:
      return {
        number: number + 1,
      };
    case MINUS:
      return {
        number: number - 1,
      };
    default:
      return state;
  }
};

export default reduce;
